<template>
    <div class="personal-center">
        <personal-information :src="userInfo.pic" :name="userInfo.realname"
                              :address="userInfo.address"></personal-information>
        <div class="nav-menu-button bottom-ash-line">
            <title-normal title="我的订单" tip="" :route="routeOption" class="header"/>
            <nav-group-normal :dataset="navButtonGroup" class="body"/>
        </div>
        <operation src="wallet-fuse.png" path="/salesman/personal-center/profit" title="我的收益"/>
        <operation src="salesman.png" path="/temporaryDirector/my-salesman" title="我的业务员"/>
        <operation src="salesman.png" path="/temporaryDirector/my-yeji" title="业绩浏览"/>
        <operation src="home.png" :path="'/salesman/order-shop?count=' + count" :tag="count" title="我的服务门店"/>
        <operation src="clock.png" path="/public/message-list" title="消息通知"/>
        <operation src="setting.png" path="/public/securitySettings" title="安全设置"/>
        <operation src="setting.png" path="/temporaryDirector/temporary-integral-order-list" title="积分商品订单确认"/>
        <tab-group :dataset="navButtonTab" :index="3"></tab-group>
    </div>
</template>

<script>
    import TabGroup from "../../components/currency/tab/tab.vue";
    import PersonalInformation from '../../components/currency/personal/information.vue';
    import TitleNormal from '../../components/currency/title/normal.vue';
    import NavGroupNormal from '../../components/currency/nav-group/normal.vue';
    import Operation from '../../components/currency/personal/operation.vue';

    export default {
        name: "temporary-center",
        components: {
            TabGroup, PersonalInformation, TitleNormal,
            NavGroupNormal,
            Operation
        },
        data() {
            return {
                count: '',
                routeOption: {path: '/temporaryDirector/order-listing', data: {index: 0}},
                navButtonGroup: [
                    {
                        name: "待上交", route: {
                            path: '/temporaryDirector/order-listing',
                            data: {
                                index: 0
                            }
                        }
                    },
                    {
                        name: "待确认", route: {
                            path: '/temporaryDirector/order-listing',
                            data: {
                                index: 1
                            }
                        }
                    },
                    {
                        name: "已上交", route: {
                            path: '/temporaryDirector/order-listing',
                            data: {
                                index: 2
                            }
                        }
                    },
                    {
                        name: "已取消", route: {
                            path: '/temporaryDirector/order-listing',
                            data: {
                                index: 3
                            }
                        }
                    }
                ],
                navButtonTab: [
                    {
                        name: "订单", route: {path: '/temporaryDirector/index'}
                    },
                    {
                        name: "待取点", route: {path: '/temporaryDirector/waiting-point-map'}
                    },
                    {
                        name: "查询报价", route: {path: '/temporaryDirector/enquiry-quotation'}
                    },
                    {
                        name: "个人中心", route: {path: '/temporaryDirector/temporary-center'}
                    }
                ],
            }
        },
        computed: {
            userInfo() {
                return this.$store.state.options.user.oda
            }
        },
        mounted() {
            this.getServerCount();
        },
        methods: {
            getServerCount() {
                var that = this;
                var url = '/api/home/user/getlist';
                var param = {
                    page: 0,
                    list_rows: 10,
                    status: 1,
                    token: this.$store.state.options.user.token
                };
                this.$util.postRequestInterface(url, param, (res) => {
                    that.count = res.data.count
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
    .nav-menu-button {

        .header {
            padding: 1rem;
            border-bottom: 0.1rem solid #EEEEEE;
        }

        .body {
            margin: 2rem 0rem 1.6rem;
        }
    }
</style>
